package jp.business.utils.logic.exception;

import jp.business.utils.common.myInterface.ResultCode;

/**
 * @className: ServerException
 * @description: 异常处理类
 * @author: 云野
 * @date: 2021/12/2
 */
public class ServerException extends RuntimeException {
  private static final long serialVersionUID = 6623717170148704700L;
  private String code;

  public ServerException(String code, String message) {
    super(message);
    this.code = code;
  }

  public ServerException(ResultCode resultCode) {
    super(resultCode.getMsg());
    this.code = resultCode.getResultCode();
  }

  public ServerException(String code, String message, Throwable cause) {
    super(message, cause);
    this.code = code;
  }

  public String getCode() {
    return code;
  }
}
